package com.example.nophase.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.example.nophase.R;
import com.example.nophase.entity.AdultItemDTO;

import java.util.List;

public class TaskListActivityAdapter extends BaseAdapter {
    List<AdultItemDTO> list;
    Context context;

    public TaskListActivityAdapter(List<AdultItemDTO> list, Context context) {
        this.list = list;
        this.context = context;
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return list.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View view = LayoutInflater.from(context).inflate(R.layout.task_item_layout,null);
        TextView num = view.findViewById(R.id.task_lv_item_num);
        TextView money = view.findViewById(R.id.task_lv_date);
        num.setText(list.get(position).getTheme());
        money.setText(list.get(position).getCreateTime());
        return view;
    }
}
